package com.qf.controller;/*
 *保护你的大熊
 *2021/12/15
 *22:28
 */

import com.qf.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Value("${name}")
    private String name;

    @Value("${users[0].username}")
    private String username;
    @Value("${users[1].sex}")
    private String sex;

    @Autowired
    private User user;

    @RequestMapping("/test")
    public String test(){

        System.out.println("username ::"+ username);
        System.out.println("sex ::"+ sex);
        System.out.println("user ::"+ user);
        return "success";
    }
}
